package com.oneguy.control.timer;

/**
 * Created by ZuoShu on 16/12/7.
 */
public class TimerTask implements Comparable<TimerTask> {
    private long time;

    private String roomId;
    private String tableId;
    private String factor;

    public TimerTask(String roomId, String tableId, String factor, long time) {
        this.time = time;
        this.roomId = roomId;
        this.tableId = tableId;
        this.factor = factor;
    }

    public String getRoomId() {
        return roomId;
    }

    public void setRoomId(String roomId) {
        this.roomId = roomId;
    }

    public String getTableId() {
        return tableId;
    }

    public void setTableId(String tableId) {
        this.tableId = tableId;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public String getFactor() {
        return factor;
    }

    public void setFactor(String factor) {
        this.factor = factor;
    }

    @Override
    public int compareTo(TimerTask o) {
        if (time > o.time) {
            return 1;
        } else {
            return -1;
        }
    }

    @Override
    public String toString() {
        return "TimerTask{" +
                "time=" + time +
                ", roomId='" + roomId + '\'' +
                ", tableId='" + tableId + '\'' +
                ", factor='" + factor + '\'' +
                '}';
    }
}
